#!/bin/bash
###
export PPROF_TMPDIR=/data/wsserver/pprof
umask 022;

host=$1
path=$2
dateformat=$3
go tool pprof -inuse_space -png ${host}/debug/pprof/heap > ${path}/${dateformat}.png

cd /data/wsserver/
rm -rf pprof/*.pb.gz
find ./ -name "*.png" -mtime +1 -exec rm -rf {} \;
